package com.pth.action;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.pth.model.SignUp;
import com.pth.model.UserInfo;
import com.pth.service.SignUpService;
import com.pth.service.UserInfoService;

@SuppressWarnings("serial")
public class PrintZhunkaozhengAction extends ActionSupport {

	
	private UserInfo userinfo;
	private UserInfoService infoService;
	private SignUpService signUpService;
	private SignUp signUp;
	
	public UserInfoService getInfoService() {
		return infoService;
	}

	public void setInfoService(UserInfoService infoService) {
		this.infoService = infoService;
	}
	
	
	public String printbmb() throws Exception {

		UserInfo u=(UserInfo)ServletActionContext.getRequest().getSession().getAttribute("userinfo");
		
		userinfo=infoService.getInfoByCard(u.getIdentitycard());
		
		return "printbmb";
	}
	
	

	@Override
	public String execute() throws Exception {

		UserInfo u=(UserInfo)ServletActionContext.getRequest().getSession().getAttribute("userinfo");
		
		userinfo=infoService.getInfoByCard(u.getIdentitycard());
		
		signUp=signUpService.getSignUpsByCard(userinfo.getIdentitycard(), userinfo.getExam().getEid());
		
		return SUCCESS;
	}

	public void setUserinfo(UserInfo userinfo) {
		this.userinfo = userinfo;
	}

	public UserInfo getUserinfo() {
		return userinfo;
	}

	public void setSignUpService(SignUpService signUpService) {
		this.signUpService = signUpService;
	}

	public SignUpService getSignUpService() {
		return signUpService;
	}

	public void setSignUp(SignUp signUp) {
		this.signUp = signUp;
	}

	public SignUp getSignUp() {
		return signUp;
	}
}
